<?php

// 本文档自动生成，仅供测试运行
class IndexAction extends BaseHomeAction {

	//测试用例专用
	public function demo() {
		$start = mktime(0, 0, 0, 12, 31, 2011);
		$end = mktime(0, 0, 0, 1, 1, 2012);
	}
	//显示Note列表
	public function index() {
		if ($this->school) {
			redirect(__ROOT__ . "/" . $this->school["school_abbr"]);
		} else {
			$this->display("Index_default");
		}
	}

	public function show() {
		$this->init();
		$cate_id = $_GET['cate_id'];
		//选择显示类别
		if ((int) $cate_id > 0) {
			$data['cate_id'] = $cate_id;
		}
		$this->assign('school', $this->school);
		$this->display("Index_index");
	}
	
	public function locationShow() {
		$location = $_POST['location'];
		if(!empty($location)){
			$data['location_name'] = array('like','%'.$location.'%');
			$result = D('Location')->where($data)->select();
		}
		$this->assign('location',$result);
		dump($result);
	}
	/**
	  +----------------------------------------------------------
	 * 探针模式
	  +----------------------------------------------------------
	 */
	public function checkEnv() {
		load('pointer', THINK_PATH . '/Tpl/Autoindex'); //载入探针函数
		$env_table = check_env(); //根据当前函数获取当前环境
		echo $env_table;
	}

}

?>